//
//  NSString+Extension.m
//  NKMapTest
//
//  Created by SongGang on 2017/3/8.
//  Copyright © 2017年 NK. All rights reserved.
//

#import "NSString+Extension.h"

@implementation NSString (Extension)
+ (instancetype)stringWithBusName:(NSString *)busName {

    // 判断"("的个数
    NSInteger count = [busName componentsSeparatedByString:@"("].count - 1;
    if (count < 3) {
        NSRange range = [busName rangeOfString:@"(" options:NSBackwardsSearch];
        busName = [busName substringToIndex:range.location];
    }else {
        NSRange range = [busName rangeOfString:@")"];
        busName = [busName substringToIndex:range.location + 1];
    }
    
    return busName;
}
@end
